package com.onegene.pdf.component.report.cancer;

import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.layout.Style;
import com.itextpdf.layout.borders.Border;
import com.itextpdf.layout.borders.SolidBorder;
import com.itextpdf.layout.property.BorderRadius;
import com.itextpdf.layout.property.TextAlignment;
import com.itextpdf.layout.property.VerticalAlignment;
import com.onegene.pdf.component.entity.ReportBean;

/**
 * @author: laoliangliang
 * @description:
 * @create: 2020/5/20 8:34
 **/
public class CancerStyle {

    public static Style getSecondTitleStyle() {
        Style style = new Style();
        style.setFontSize(16);
        style.setMarginTop(8);
        style.setFontColor(CancerColor.getThemeColor());
        return style;
    }

    public static Style getThirdTitleStyle() {
        Style style = new Style();
        style.setFontSize(14);
        style.setFontColor(CancerColor.getThemeColor());
        return style;
    }

    public static Style getDefaultCell() {
        Style style = new Style();
        style.setPadding(0);
        style.setBorder(Border.NO_BORDER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        style.setHeight(30);
        return style;
    }

    public static Style getSimpleDescCell() {
        Style style = new Style();
        style.setHeight(22);
        style.setBorder(Border.NO_BORDER);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        style.setTextAlignment(TextAlignment.CENTER);
        style.setPaddingLeft(10);
        style.setPaddingTop(10);
        return style;
    }

    public static Style getExamineeStyle() {
        Style style = new Style();
        style.setFontSize(12);
        return style;
    }

    public static Style getSignStyle() {
        Style style = new Style();
        style.setFontSize(9);
        style.setCharacterSpacing(1);
        return style;
    }

    public static Style getTableHeaderStyle() {
        Style style = new Style();
        style.setBackgroundColor(CancerColor.getThemeColor()).setFontColor(ColorConstants.WHITE);
        style.setFontSize(10f);
        return style;
    }

    public static Style getTableContextStyle() {
        Style style = new Style();
        style.setFontSize(10f);
        style.setPadding(-1);
        return style;
    }

    public static Style getItemTitleStyle() {
        Style style = new Style();
        style.setFontSize(14f);
        style.setFontColor(ColorConstants.WHITE);
        style.setBackgroundColor(CancerColor.getThemeColor());
        return style;
    }

    public static Style getItemLabelStyle(ReportBean.ItemsBean itemsBean) {
        Style style = new Style();
        style.setFontSize(10f);
        style.setFontColor(ColorConstants.WHITE);
        style.setBorderRadius(new BorderRadius(3));
        style.setWidth(70);
        style.setHeight(35);
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        if (itemsBean.getIndex()<=2) {
            style.setBackgroundColor(CancerColor.getThemeColor());
        } else if (itemsBean.getIndex() == 3) {
            style.setBackgroundColor(CancerColor.getOrange());
        } else if (itemsBean.getIndex() == 4) {
            style.setBackgroundColor(CancerColor.getRed());
        }
        return style;
    }

    public static Style getGeneDescCellStyle() {
        Style style = new Style();
        style.setPadding(-2);
        style.setFontSize(8);
        return style;
    }

    public static Style getTableCell() {
        Style style = new Style();
        style.setVerticalAlignment(VerticalAlignment.MIDDLE);
        style.setBorder(new SolidBorder(CancerColor.getThemeColor(), 1.08f));
        return style;
    }

    public static Style getOff() {
        Style style = new Style();
        style.setMarginTop(2);
        return style;
    }

    public static Style getOff2() {
        Style style = new Style();
        style.setMarginTop(2);
        return style;
    }

    public static Style getTableHeader() {
        Style style = new Style();
        style.setBackgroundColor(CancerColor.getThemeColor()).setFontColor(ColorConstants.WHITE);
        return style;
    }
}